<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="一个美丽的本地TODO应用，支持待办事项管理和便签笔记" />
    <title>开始你的待办事项 - 优华 TODO</title>
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;

      }
      /* 加载动画 */
      #loading {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #faf9f6 0%, #fff8e7 50%, #ffefd5 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        transition: opacity 0.5s ease;
      }
      #loading.fade-out {
        opacity: 0;
        pointer-events: none;
      }
      .loading-content {
        text-align: center;
        color: #8b5a8c;
      }
      .loading-spinner {
        width: 50px;
        height: 50px;
        border: 4px solid #e8d8e8;
        border-top: 4px solid #d8a7ca;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto 1rem;
      }
      @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
      }
      .loading-text {
        font-size: 1.2rem;
        font-weight: 600;
        font-family: 'Comic Sans MS', 'Microsoft YaHei', sans-serif;
      }
    </style>
  </head>

  <body>
    <!-- 加载画面 -->
    <div id="loading">
      <div class="loading-content">
        <div class="loading-spinner"></div>
        <div class="loading-text">正在启动您的TODO助手... 🌸</div>
      </div>
    </div>
    
    <div id="app"></div>
    <script type="module" src="/src/main.ts"></script>
    <script>
      // 页面加载完成后隐藏加载动画
      window.addEventListener('load', function() {
        setTimeout(function() {
          const loading = document.getElementById('loading');
          if (loading) {
            loading.classList.add('fade-out');
            setTimeout(function() {
              loading.style.display = 'none';
            }, 500);
          }
        }, 1000);
      });
    </script>
  </body>
</html>
